#include <iostream>
#include <initializer_list>

using namespace std;

int makeSum(initializer_list<int> values)
{
	int total{ 0 };
	for (int value : values) {
		total += value;
	}
	return total;
}

int main()
{
	int a{ makeSum({ 1, 2, 3 }) };
	int b{ makeSum({ 10, 20, 30, 40, 50, 60 }) };


	// Copy list initialization
	auto a2 = { 11 }; // initializer_list<int>
	auto b2 = { 11, 22 }; // initializer_list<int>
	
	// Direct list initialization
	auto c { 11 }; // int
	auto d = { 11, 22 }; // Error, too many elements.


}
